package com.secondary.service;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import com.secondary.dao.goods.GoodsDao;
import com.secondary.pojos.Goods;
import com.secondary.pojos.GoodsPic;
@Service
public class GoodsService {
	@Resource
	private GoodsDao goodsDao;
	public List listGoodsByParentId(int id){
		return goodsDao.findGoodsByParentsId(id);
	}
	public Goods findGood(int id){
		return goodsDao.findGoodById(id);
	}
	public void saveGood(Goods good){
		goodsDao.saveObject(good);
	}
	public void savePic(GoodsPic pic){
		goodsDao.saveObject(pic);
	}
	public List<Goods> findGoodsByUserId(int id){
		return goodsDao.findGoodsByUserId(id);
	}
	public void deleteGoods(List<Integer> ids){
		goodsDao.deleteGoods(ids);
	}
	public List<Goods> findGoodsByName(String name){
		return goodsDao.findGoodsByName(name);
	}
	public void deletePic(int id){
		goodsDao.deletePic(id);
	}
	public void updateGoodsInfo(Goods good){
		goodsDao.updateGoodsInfo(good);
	}
}
